import requestPlat from '@/common/requestPlat'
import Qs from 'qs';

// 我的服务列表
export let pageMyService = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/authorize/page/${params.page}/${params.limit}`,
		params
	})
}
// 发放服务/其他服务列表
export let pageOtherService = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/issue/authorize/page/${params.page}/${params.limit}`,
		params
	})
}
// 我的服务详情
export let detailMyService = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/authorize/detail`,
		params
	})
}
// 我的服务添加
export let addMyService = (data) => {
	return requestPlat({
		method: 'post',
		url: `serve/authorize/add`,
		headers: {
			"Content-Type": 'application/json'
		},
		data
	})
}
// 我的服务编辑
export let editMyService = (data) => {
	return requestPlat({
		method: 'post',
		url: `serve/authorize/edit`,
		headers: {
			"Content-Type": 'application/json'
		},
		data
	})
}
// 我的服务操作
export let opMyService = (data) => {
	return requestPlat({
		method: 'post',
		url: `serve/authorize/op?opid=${data.opid}&field=${data.field}&value=${data.value}`
	})
}

// 发放服务（其他服务商选择服务列表）
export let getOtherGrantService = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/issue/authorize/list`,
		params
	})
}
// 发放服务（我的服务选择服务列表）
export let getMyGrantService = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/authorize/list`,
		params
	})
}
// 客户列表
export let getCustomerList = (params) => {
	return requestPlat({
		method: 'get',
		url: `customer/authorize/list`,
		params
	})
}
// 商户列表
export let getMerchantList = (params) => {
	return requestPlat({
		method: 'get',
		url: `procure/authorize/team/list`,
		params
	})
}

// 发放服务
export let addGrantService = (data) => {
	return requestPlat({
		method: 'post',
		url: `serve/issue/authorize/add`,
		headers: {
			"Content-Type": 'application/json'
		},
		data
	})
}
// 发放记录
export let getIssueList = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/issue/authorize/issue/list`,
		params
	})
}
// 核销记录
export let getCheckList = (params) => {
	return requestPlat({
		method: 'get',
		url: `serve/authorize/employ/list`,
		params
	})
}
// 服务核销
export let checkService = (data) => {
	return requestPlat({
		method: 'post',
		url: `serve/authorize/employ/add`,
		headers: {
			"Content-Type": 'application/json'
		},
		data
	})
}
// 服务作废
export let cancelService = (data) => {
	return requestPlat({
		method: 'post',
		url: `serve/issue/authorize/cancel?issueId=${data.issueId}`,
	})
}
